﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace InkjetControl.bean
{
    public class PostPrintParamsBean<T>
    {
        private PostPrintParamsBean(bool single, ref T printParams)
        {
            Single = single;
            PrintParams = printParams;
        }

        [JsonProperty("single")]
        public bool Single { get; set; }

        [JsonProperty("params")]
        public T PrintParams { get; set; }

        public static PostPrintParamsBean<T1> GenerateParams<T1>(bool single, ref T1 printParams)
        {
            return new PostPrintParamsBean<T1>(single, ref printParams);
        }

    }

    public class SingleParam<T>
    {
        public SingleParam(string key, T value)
        {
            Key = key ?? throw new ArgumentNullException(nameof(key));
            Value = value;
        }

        [JsonProperty("key")]
        public string Key { get; set; }

        [JsonProperty("value")]
        public T Value { get; set; }
    }
}
